<template>
  <div class="bpl1-bg el-flex">
    <div class="el-mr-3">
      <div class="el-flex">
        <div class="co-title-name">
          <img src="@/assets/cockpit/subdivision/securityOneMap/item4-title.png" alt="" />
        </div>
        <div class="co-title-right co-title-right-flex">
          <div class="co-title-breathe"><i></i><i></i><i></i><i></i><i></i><i></i></div>
        </div>
      </div>
      <div class="content">
        <div class="el-flex">
          <div class="left el-mr-2">
            <p class="title">补办集体建设用地手续项目</p>
            <div class="count"><span class="label">项目数：</span><span class="number">11,233</span>栋</div>
            <div class="count"><span class="label">总面积：</span><span class="number">11,233</span>亩</div>
          </div>
          <div class="chart-box1">
            <p class="title">处理情况</p>
            <div class="done tag"><span>已处置</span> <span><b>512</b>项</span></div>
            <div class="bpr2-chartbox">
              <div class="bpr2-chart-bg"></div>
              <div class="box-chart" id="boxChart5"> </div>
            </div>
            <ul class="zx-list">
              <li v-for="(item, index) in listArr" :key="index">
                <div class="icon" :style="`background:${colorArr[index]}`"></div>
                <div class="label">
                  {{ item.label }}

                  <!-- <span>
                    {{ item.value }}
                  </span> -->
                </div>
              </li>
            </ul>
          </div>
        </div>

      </div>
    </div>
    <div>
      <div class="el-flex">
        <div class="co-title-name">
          <img src="@/assets/cockpit/subdivision/securityOneMap/item5-title.png" alt="" />
        </div>
        <div class="co-title-right co-title-right-flex">
          <div class="co-title-breathe"><i></i><i></i><i></i><i></i><i></i><i></i></div>
        </div>
      </div>
      <div class="content el-mt-4">
        <div class="top el-flex">
          <div class="item5_2-icon el-mr-2">
            <img src="@/assets/cockpit/subdivision/securityOneMap/item5-1-icon.png" alt="" />
          </div>
          <div class="right">
            <div class="right-top">
              <span>隐患点总数</span>
              <p><b>809</b>处</p>
            </div>
            <div class="table">
              <div class="table-col">
                <p class="table-title">小型隐患</p>
                <p class="table-value"><b>10</b>处</p>
              </div>
              <div class="table-col">
                <p class="table-title">中型隐患</p>
                <p class="table-value yellow"><b>20</b>处</p>
              </div>
              <div class="table-col">
                <p class="table-title">大型隐患</p>
                <p class="table-value red"><b>30</b>处</p>
              </div>
              <div class="table-col">
                <p class="table-title">巨大隐患</p>
                <p class="table-value deep-red"><b>15</b>处</p>
              </div>
            </div>

          </div>
        </div>
        <div class="bottom">
          <div class="tag"><span>不确定</span> <span><b>512</b>处</span></div>
          <div class="tag"><span>一般</span> <span><b>512</b>处</span></div>
          <div class="tag"><span>较稳定</span> <span><b>512</b>处</span></div>
          <div class="tag"><span>稳定</span> <span><b>512</b>处</span></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'
import { CockpitApi } from '@/api/cockpit'
import Highcharts from 'highcharts/highstock'
@Component({
  name: 'Item5'
})
export default class Item5 extends Vue {
  private colorArr = [
    '#49C384',
    '#2B8EF3',
    '#E42C31',
    '#F79014',
    '#DAFA94',
    '#49C384',
    '#2B8EF3',
    '#E42C31',
    '#F79014',
    '#DAFA94'
  ]
  private options: any = {
    credits: {
      enabled: false
    },
    chart: {
      type: 'pie',
      plotBackgroundColor: null,
      plotBorderWidth: null,
      plotShadow: false,
      backgroundColor: null,
      options3d: {
        enabled: true,
        alpha: 60
      }
    },
    title: {
      text: null
    },
    subtitle: {
      text: null
    },
    plotOptions: {
      pie: {
        size: 90,
        innerSize: 70,
        depth: 20,
        dataLabels: {
          //数据标签
          enabled: false //是否启用
        },
        showInLegend: false
      }
    },
    legend: {
      layout: 'vertical',
      align: 'right',
      // verticalAlign: 'middle',
      floating: true,
      symbolwidth: 6,
      symbolHeight: 6,
      itemStyle: {
        fontSize: '12px',
        color: '#fff',
        fontWeight: 'normal',
        paddingTop: '20px'
      },
      itemHoverStyle: {
        color: '#00EAFF'
      }
    },
    series: [
      {
        name: '占比（%）',
        center: ['24%', '40%'],
        colors: this.colorArr,
        data: [
          ['未拆除', 50],
          ['已拆除', 50],
          ['已延期', 50],
          ['正常使用', 50]
        ]
      }
    ]
  }

  private listArr = [
    {
      value: 10,
      label: '拆除'
    },
    {
      value: 9,
      label: '没收'
    },
    {
      value: 8,
      label: '退还土地'
    },
    {
      value: 7,
      label: '罚款'
    }
  ]
  created() {}
  mounted() {
    this.init()
  }
  init() {
    // console.log(this.rankData, 'this.rankData')
    // this.options.series[0].data = this.rankData
    this.chart = new Highcharts.Chart('boxChart5', this.options)
  }
}
</script>
<style lang="scss" scoped>
@import '~@/styles/cockpit.scss';
.bpl1-bg {
  width: 100%;
  height: 100%;
  padding: 16px;
  background: url('~@/assets/cockpit/subdivision/administration/item-bg4.png') no-repeat 0/ 100% 100%;
  position: relative;
  display: flex;
  // flex-direction: column;
  & > div {
    flex-grow: 1;
    &:first-of-type {
      width: 464px;
      flex-shrink: 0;
    }
  }
  .co-title {
    flex-shrink: 0;
  }
  .co-title-right-flex {
    display: flex;
    .text {
      font-size: 12px !important;
      color: rgba(223, 254, 255, 1);
      margin-top: 8px;
      margin-right: 6px;
    }
  }
}
.content {
  // margin: 12px 0;
  .count {
    display: flex;
    align-items: center;
    background: url('~@/assets/cockpit/subdivision/securityOneMap/count-bg.png') no-repeat;
    background-size: 100% 100%;
    height: 68px;
    color: #fff;
    padding-left: 17px;
    margin-bottom: 8px;
    &:last-of-type {
      margin-bottom: 0;
    }
    .label {
      color: rgba(0, 181, 211, 1);
      // font-size: 18px !important;
    }
    .number {
      font-weight: 700;
      font-family: 'Roboto';
      margin-right: 5px;
      font-size: 22px !important;
    }
  }
  .title {
    position: relative;
    display: flex;
    align-items: center;
    width: 200px;
    height: 8px;
    margin: 12px;
    // line-height: 24px;
    font-size: 14px !important;
    color: #fff;
    margin-top: 18px;
    margin-bottom: 18px;
    background: linear-gradient(90deg, rgba(0, 106, 255, 1) 0%, rgba(0, 106, 255, 0) 100%);
    &::before {
      content: '';
      display: block;
      width: 2px;
      height: 8px;
      margin-right: 6px;
      background: rgba(0, 234, 255, 1);
      box-shadow: 0 0 8px 0 rgba(0, 149, 255, 1);
    }
  }
  .bpr2-chartbox {
    width: 100%;
    height: 100px;
    position: relative;
    margin-top: 10px;
    // margin-left: 10px;
    // margin-left: -20px;
    .box-chart {
      width: 100%;
      height: 100%;
      margin-top: -10px;
    }
    .bpr2-chart-bg {
      width: 140px;
      height: 100px;
      background: url('~@/assets/cockpit/bpr2-chart-bg.png') no-repeat 0/ 100% 100%;
      position: absolute;
      left: -1px;
      top: 14px;
      z-index: -1;
    }
  }
  .chart-box1 {
    position: relative;
    .zx-list {
      position: absolute;
      right: -150px;
      top: 72px;
      color: #fff;
      font-size: 12px !important;
      display: flex;
      flex-wrap: wrap;
      width: 220px;
      margin-top: 30px;
      li {
        width: 100%;
        display: flex;
        margin-top: 8px;
        .icon {
          width: 10px;
          height: 10px;
          background: rgba(73, 195, 132, 1);
        }
        .label {
          width: calc(100% - 20px);
          margin-left: 10px;
          text-overflow: ellipsis;
          overflow: hidden;
          white-space: nowrap;
          span {
            margin-left: 4px;
          }
        }
      }
    }
  }
}
.tag {
  height: 40px;
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  > span {
    color: #fff;
    b {
      display: inline-block;
      margin-right: 3px;
      font-size: 16px !important;
      font-weight: bold;
      font-family: 'Roboto';
    }
    &:nth-of-type(1) {
      margin-left: 10px;
    }
    &:nth-of-type(2) {
      margin-left: auto;
    }
  }
  &::before {
    content: '';
    width: 7px;
    height: 7px;
    opacity: 1;
    background: rgba(249, 240, 212, 1);
    box-shadow: 0 0 8px 0 rgba(240, 176, 74, 1);
    transform: rotate(45deg);
  }
}
.bottom {
  display: flex;
  flex-wrap: wrap;
  margin-top: 16px;
  .tag {
    width: 40%;
    flex-grow: 1;
    margin-right: 12px;
    margin-bottom: 12px;
    &:nth-of-type(even) {
      margin-right: 0;
    }
  }
}
.right {
  flex-grow: 1;
}
.right-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 17px;
  background: linear-gradient(270deg, rgba(0, 144, 185, 0.45) 0%, rgba(0, 144, 185, 0) 81%);
  color: #fff;
  span {
    display: inline-block;
    font-size: 16px !important;
    line-height: 22px;
  }
  b {
    font-size: 30px !important;
    line-height: 22px;
    font-weight: bold;
  }
}
.table {
  display: flex;
  color: #fff;
  margin-top: 8px;
  .table-title {
    color: #bffeff;
  }
  .table-col {
    width: 25%;
  }
  .table-value {
    &.yellow {
      color: #ffcd3e;
    }
    &.red {
      color: #e05713;
    }
    &.deep-red {
      color: #ff3131;
    }
    b {
      display: inline-block;
      margin-right: 4px;
      font-weight: bold;
      font-size: 18px;
    }
  }
}
</style>
